Skip to content

Comments

Port diagnostic attributes#151558

Open
mejrs wants to merge 17 commits intorust-lang:mainfrom
mejrs:port_on_unimplemented
Open

Port diagnostic attributes#151558
mejrs wants to merge 17 commits intorust-lang:mainfrom
mejrs:port_on_unimplemented

Conversation

@mejrs
Copy link
Contributor

@mejrs mejrs commented Jan 23, 2026

View all comments

Ports all the diagnostic attributes: on_const, on_unimplemented and rustc_on_unimplemented.

I thought about migrating them one by one but that would leave a lot of code duplicated. So this PR looks big but it's mostly a lot of moving code around with slight modifications.

r? @JonathanBrouwer

cc @jdonszelmann feel free to review if you want, not sure which of you wants it.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 23, 2026
@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 23, 2026
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 23, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

☀️ Try build successful (CI)
Build commit: e5e5a65 (e5e5a6588240040eb81cfb52d8b9c3281547ef47, parent: d222ddc4d90743dfc1e53b610be8fc9d95893d2c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e5e5a65): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -1.7%, secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
-1.7% [-1.7%, -1.7%] 1
Improvements ✅
(secondary)
-4.2% [-4.2%, -4.2%] 1
All ❌✅ (primary) -1.7% [-1.7%, -1.7%] 1

Cycles

Results (secondary -4.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.3% [-4.9%, -3.0%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 470.684s -> 471.14s (0.10%)
Artifact size: 383.48 MiB -> 383.64 MiB (0.04%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 24, 2026
@fmease fmease changed the title Port diagnosttic::unimplemented Port diagnosttic::on_unimplemented Jan 24, 2026
@rust-bors

This comment has been minimized.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations T-release Relevant to the release subteam, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 2, 2026
@mejrs mejrs force-pushed the port_on_unimplemented branch from 314a3ab to a1841a0 Compare February 2, 2026 12:03
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@mejrs mejrs force-pushed the port_on_unimplemented branch from f85b181 to 3e1d86b Compare February 14, 2026 17:44
@mejrs mejrs force-pushed the port_on_unimplemented branch from 3e4daeb to 10525e6 Compare February 18, 2026 23:30
@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@mejrs
Copy link
Contributor Author

mejrs commented Feb 19, 2026

I think that's everything,

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 19, 2026
@jdonszelmann
Copy link
Contributor

@mejrs I think the only thing left here now is the templates right?

@mejrs mejrs force-pushed the port_on_unimplemented branch from 77b71c7 to 1556755 Compare February 19, 2026 21:01
@mejrs
Copy link
Contributor Author

mejrs commented Feb 19, 2026

@mejrs I think the only thing left here now is the templates right?

Oops. Pushed now.

@JonathanBrouwer
Copy link
Contributor

@jdonszelmann r=me,you if you also approve the PR

@jdonszelmann
Copy link
Contributor

@bors r=jdonszelmann,jonathanbrouwer rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📌 Commit 1556755 has been approved by jdonszelmann,jonathanbrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2026
@jdonszelmann
Copy link
Contributor

@bors r- #152759 first

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 20, 2026
@jdonszelmann
Copy link
Contributor

@mejrs r=me after rebase

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

☔ The latest upstream changes (presumably #152904) made this pull request unmergeable. Please resolve the merge conflicts.

NoMangle(..) => Yes, // Needed for rustdoc
NoStd(..) => No,
NonExhaustive(..) => Yes, // Needed for rustdoc
OnConst { .. } => Yes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just a drive by comment, but I'm not 100% sure if that's really correct. In the past there was a bug were an unstable diagnostic attribute generated a warning in the parent crate, but had also generated the unstable custom error message if triggered by code in a child crate.

For that reason I changed the cross crate encoding for such attributes at some point to be depended on the feature gate for such unstable attributes.

That written: I'm do know nothing about diagnostic::on_const and the design of this PR, so this might not even apply. If that's the case feel free to just dismiss this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants